Atof (converts a string to a float number) related functions atoi, atol, strtodd, strtol, strtoul header file # include
define the function
double atof (const char * nptr);
function description
atof () scans
C language Strtol () function: Converts a string to long (Long integer)header file:
#include
The Strtol () function is used to convert a string to a long integer, which is a prototype:
Long int strtol (const char* STR, char**
Atof (converts a string to a float number)Related functionsAtoi, atol, strtodd, strtol, strtoulHeader file# Include Define functionsDouble atof (const char * nptr );Function DescriptionAtof () will scan the nptr parameter string, skip the leading
Role:
Converts a string to decimal by using the function strtoul (const char *, char * *, int) in the corresponding binary format
char* p;//Position string conversion termination
unsigned long s = Strtoul ("FFt6", &p,);
NSLog (@ "%lu",
It is often used to convert strings and numbers. It is easy to collect and sort them. Then you can use atof (convert string to float type) atoi (convert string to integer type) atol (convert string to integer type) strtol (convert string to floating
I. Functions in the Character Processing Library# Include Function prototype: int f (int c)Function Description: the C language defines whether to process character operations, including whether it is a number, letter, print character, hexadecimal
Atof (convert a string to a float number) atoi (convert a string to an integer number) atol (convert a string to an integer number)
Strtol (convert string to floating point number) strtol (convert string to integer) strtoul (convert string to
This article describes the C language implementation of the method of converting strings to numbers. Share to everyone for your reference. The implementation methods are as follows:
The C language provides several standard library functions that
The C language provides several standard library functions that can convert a string to a number of any type (integer, long, float, and so on). The following is an example of converting a string to an integer using the Atoi () function:# include #
1. short integer (int)Itoa (i,temp,10);/////Convert I to a string into temp, and the last digit to indicate decimalItoa (i,temp,2); Converting in binary mode2. Long integer typeLtoa (l,temp,10);3. Floating point (float,double)The conversion can be
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.